<%--
  Created by IntelliJ IDEA.
  User: LX
  Date: 2017/6/8
  Time: 15:50
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title></title>
</head>

<body>
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="main" style="width:100%;height:100%;" ></div>
<script  src="${request.getContextPath()}/js/echarts/echarts.js"></script>
<script  src="${request.getContextPath()}/js/echarts/echarts-tool.js"></script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var contextPath = "${request.getContextPath()}";
    eChartsTool.init(contextPath);
    var data=[];
    <g:each in="${Report_084img}" status="i" var="tableInstance">
    data.push('${tableInstance.REWORK_CODE}');
    </g:each>

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: ''
        },

        tooltip : {
            trigger: 'rework'
        },
        legend: {
            data:['返工数量','返工比率']
        },
        xAxis: {
            data:data,
            axisLabel:{
                interval:0
//                rotate:-30
            }
        },
        yAxis : [
            {
                type : 'value',
                name:'返工数量',
                axisLabel : {
                    formatter: '{value}'
                },
                show:true
            },
            {
                type : 'value',
                name:'返工比率',

                axisLabel : {
                    formatter: '{value}%'
                },
                show:true
            }
        ],
        series : [
            {
                name: '返工数量',
                type: 'bar',
                data:${Report_084img.REWORK_QTY}
            },
            {
                name: '返工比率',
                type: 'line',
                data:${list},
                yAxisIndex: 1
            }]
    };
    // 使用刚指定的配置项和数据显示图表。
    eChartsTool.setOption("dark", document.getElementById('main'), option);
</script>
</body>
</html>